#pragma once
#include "Headers.h"

using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
using namespace WeifenLuo::WinFormsUI::Docking;

namespace OgreUnified {

	enum LOG_TYPE{LOG_WARNING, LOG_ERROR, LOG_INFO};
	class LogManagerInterface;

	public ref class ConsoleForm : public WeifenLuo::WinFormsUI::Docking::DockContent
	{
	public:
		ConsoleForm(void);
		void logMessage(System::String^ message, LOG_TYPE logtype);
		void logMessage(System::String^ message);
		void logMessage(const Ogre::String& message);
		static property ConsoleForm^Instance;

		void addListener();
		void removeListener();

	protected:
		~ConsoleForm();

	private: 
		delegate void AddMessage(System::String^ message, LOG_TYPE logtype);
		AddMessage^ mAddMessageDelegate;
		void addMessage(System::String ^ message, LOG_TYPE logtype);
		LogManagerInterface* mLogManagerInterface;
	
		System::Windows::Forms::ToolStrip^					mToolStrip;
		System::Windows::Forms::ToolStripButton^			mToolStripButtonNew;
		System::Windows::Forms::DataGridView^				mDataGridView;
		System::Windows::Forms::DataGridViewImageColumn^	mColumnIcon;
		System::Windows::Forms::DataGridViewTextBoxColumn^  mColumnLog;
		System::Windows::Forms::Splitter^					mSplitter;
		System::Windows::Forms::RichTextBox^				mRichTextBox;
		System::Windows::Forms::ImageList^					mImageList;
		System::ComponentModel::IContainer^  components;


		void InitializeComponent(void);
		System::Void mDataGridView_CurrentCellChanged(System::Object^  sender, System::EventArgs^  e);
		System::Void mToolStripButtonNew_Click(System::Object^  sender, System::EventArgs^  e);
		System::Void mRichTextBox_Enter(System::Object^  sender, System::EventArgs^  e);
		System::Void mDataGridView_RowsAdded(System::Object^  sender, System::Windows::Forms::DataGridViewRowsAddedEventArgs^  e);
		
	};
}
